import request, { Response } from '@/utils/request';

export interface SideBarItem {
  name: string;
  path: string;
  icon: string;
  children: SideBarItem[];
}

export interface UserModule {
  icon: string;
  children: UserModule[];
  system: boolean;
  parentId: string;
  name: string;
  uri: string;
  url: string;
  isMenu: number;
  sort: number;
}

// 获取用户的可用模块
export const getUserModule = (): Promise<Response<UserModule[]>> =>
  request('/api/user/module/list');

export const getConfig = (): Promise<Response<UserModule[]>> => request('/api/sys/site/attr');

export default getUserModule;
